package com.example.wan1.data;


import com.example.wan1.login.PersonBean;
import com.example.wan1.look.LookBean;
import com.example.wan1.model.ArticleBean;

import java.util.Map;

import io.reactivex.Observable;
import retrofit2.http.Field;
import retrofit2.http.FieldMap;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.GET;
import retrofit2.http.POST;
import retrofit2.http.Path;

/***
 * 创建时间：2019/12/6 10:30
 * 创建人：10850
 * 功能描述：
 */
public interface ApiService {

    //开始
    @FormUrlEncoded
    @POST("user/login")
    Observable<PersonBean> postLogin(@Field("username") String username, @Field("password") String password);

    @FormUrlEncoded
    @POST("user/register")
    Observable<PersonBean> postRegister(@FieldMap() Map<String, String> registerMap);

    //https://www.wanandroid.com/article/list/0/json
    @GET("article/list/{page}/json")
    Observable<LookBean> getArticleList(@Path("page") int age);

    @GET("article/list/{page}/json")
    Observable<ResponseBody<ResponseList<ArticleBean>>> getArticleList1(@Path("page") int age);
}
